//
//  HTTPTool.h
//  WuJieLive
//
//  Created by iMac on 2017/11/14.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import <Foundation/Foundation.h>

/* 请求成功不一定结果正确,因此需要将最终结果返回出去 */
typedef void(^Success)(BOOL isSuccess, id responseObject);
typedef void(^Failure)(NSError *error);


@interface HTTPTool : NSObject

@property (nonatomic , assign) BOOL isFirst;

+ (NSURLSessionTask *)POSTForm:(NSString *)urlString
                          para:(id)para
                       success:(Success)success
                       failure:(Failure)failure;

+ (void)uploadImageWithURL:(NSString *)URLString
                parameters:(id)parameters
               uploadImage:(NSData *)uploadImage
                   success:(Success)success
                   failure:(Failure)failure;
/**
 *  取消所有的操作
 */
+ (void)cancelAllOperations;



@end
